<!--
 * @Description:
 * @Version: 1.0.0
 * @Autor: zhou
 * @Date: 2022-04-23 11:49:20
 * @LastEditors: ljz
 * @LastEditTime: 2022-08-29 14:32:02

-->
<template>
    <!-- 4弹窗列表 -->
    <div class="dialog_box flexrcc">
        <ListDetail :title="epi.detail_title" @close_info="onCloseInfo">
            <div class="full-screen flexcsh">
                <div class="p-row30">
                    <EpiContentNav
                        :list="epi.detail_btn"
                        @change="changeContent"
                    ></EpiContentNav>
                </div>

                <div
                    v-if="epi.cut_content == 1"
                    class="dialog_content1 p-row30 flexrbh fx1 hidden"
                >
                    <!-- 临时造假数据用到的判断，后面干掉 -->
                    <template v-if="level == 4 && temporaryListDetailId == 3">
                        <div class="content_left m-r20">
                            <div class="item item_grid1 m-b20 flexrcc">
                                <div class="icon icon1"></div>
                                <div class="info">
                                    <div class="p-row10">
                                        <span class="num num1">618</span>
                                        <span class="unit unit1">户</span>
                                    </div>
                                    <div class="label label1">住户数</div>
                                </div>
                            </div>
                            <div class="item item_grid2 m-b20 flexrcc">
                                <div class="icon icon2"></div>
                                <div class="info">
                                    <div class="p-row10">
                                        <span class="num num2">1853</span>
                                        <span class="unit unit2">人</span>
                                    </div>
                                    <div class="label label2">居民数</div>
                                </div>
                            </div>
                        </div>
                        <div class="content_right flexcbh fx1">
                            <div class="item top m-b20">
                                <div class="flex m-b10">
                                    <div class="label">上级网格:</div>
                                    <div class="value">
                                        {{ "南康社区" }}
                                    </div>
                                </div>
                                <div class="flex">
                                    <div class="label">下级网格:</div>
                                    <div class="list fx1"></div>
                                </div>
                            </div>
                            <div class="item bottom flexcsh fx1">
                                <div class="flexrsc m-b10">
                                    <div class="label">负责人:</div>
                                    <div class="value">{{ "许光毅" }}</div>
                                    <div class="tel">
                                        {{ "13387790590" }}
                                    </div>
                                </div>
                                <div class="flex of-xhya scroll_bar">
                                    <div class="label">网格员:</div>
                                    <div class="">
                                        <div>
                                            <span class="value">{{
                                                "刘梅娅"
                                            }}</span>
                                            <span class="tel">{{
                                                "13877913133"
                                            }}</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </template>

                    <template
                        v-else-if="level == 4 && temporaryListDetailId == 4"
                    >
                        <div class="content_left m-r20">
                            <div class="item item_grid1 m-b20 flexrcc">
                                <div class="icon icon1"></div>
                                <div class="info">
                                    <div class="p-row10">
                                        <span class="num num1">634</span>
                                        <span class="unit unit1">户</span>
                                    </div>
                                    <div class="label label1">住户数</div>
                                </div>
                            </div>
                            <div class="item item_grid2 m-b20 flexrcc">
                                <div class="icon icon2"></div>
                                <div class="info">
                                    <div class="p-row10">
                                        <span class="num num2">1902</span>
                                        <span class="unit unit2">人</span>
                                    </div>
                                    <div class="label label2">居民数</div>
                                </div>
                            </div>
                        </div>
                        <div class="content_right flexcbh fx1">
                            <div class="item top m-b20">
                                <div class="flex m-b10">
                                    <div class="label">上级网格:</div>
                                    <div class="value">
                                        {{ "南康社区" }}
                                    </div>
                                </div>
                                <div class="flex">
                                    <div class="label">下级网格:</div>
                                    <div class="list fx1"></div>
                                </div>
                            </div>
                            <div class="item bottom flexcsh fx1">
                                <div class="flexrsc m-b10">
                                    <div class="label">负责人:</div>
                                    <div class="value">{{ "许光毅" }}</div>
                                    <div class="tel">
                                        {{ "13387790590" }}
                                    </div>
                                </div>
                                <div class="flex of-xhya scroll_bar">
                                    <div class="label">网格员:</div>
                                    <div class="">
                                        <div>
                                            <span class="value">{{
                                                "邓英"
                                            }}</span>
                                            <span class="tel">{{
                                                "13877997595"
                                            }}</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </template>

                    <template
                        v-else-if="level == 4 && temporaryListDetailId == 5"
                    >
                        <div class="content_left m-r20">
                            <div class="item item_grid1 m-b20 flexrcc">
                                <div class="icon icon1"></div>
                                <div class="info">
                                    <div class="p-row10">
                                        <span class="num num1">573</span>
                                        <span class="unit unit1">户</span>
                                    </div>
                                    <div class="label label1">住户数</div>
                                </div>
                            </div>
                            <div class="item item_grid2 m-b20 flexrcc">
                                <div class="icon icon2"></div>
                                <div class="info">
                                    <div class="p-row10">
                                        <span class="num num2">1702</span>
                                        <span class="unit unit2">人</span>
                                    </div>
                                    <div class="label label2">居民数</div>
                                </div>
                            </div>
                        </div>
                        <div class="content_right flexcbh fx1">
                            <div class="item top m-b20">
                                <div class="flex m-b10">
                                    <div class="label">上级网格:</div>
                                    <div class="value">
                                        {{ "南康社区" }}
                                    </div>
                                </div>
                                <div class="flex">
                                    <div class="label">下级网格:</div>
                                    <div class="list fx1"></div>
                                </div>
                            </div>
                            <div class="item bottom flexcsh fx1">
                                <div class="flexrsc m-b10">
                                    <div class="label">负责人:</div>
                                    <div class="value">{{ "许光毅" }}</div>
                                    <div class="tel">
                                        {{ "13387790590" }}
                                    </div>
                                </div>
                                <div class="flex of-xhya scroll_bar">
                                    <div class="label">网格员:</div>
                                    <div class="">
                                        <div>
                                            <span class="value">{{
                                                "肖永进"
                                            }}</span>
                                            <span class="tel">{{
                                                "13877997589"
                                            }}</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </template>

                    <!-- 这段用作后面对接接口 -->
                    <template v-else>
                        <div class="content_left m-r20">
                            <div class="item item_grid1 m-b20 flexrcc">
                                <div class="icon icon1"></div>
                                <div class="info">
                                    <div class="p-row10">
                                        <span class="num num1">358</span>
                                        <span class="unit unit1">户</span>
                                    </div>
                                    <div class="label label1">住户数</div>
                                </div>
                            </div>
                            <div class="item item_grid2 m-b20 flexrcc">
                                <div class="icon icon2"></div>
                                <div class="info">
                                    <div class="p-row10">
                                        <span class="num num2">2406</span>
                                        <span class="unit unit2">人</span>
                                    </div>
                                    <div class="label label2">居民数</div>
                                </div>
                            </div>
                        </div>
                        <div class="content_right flexcbh fx1">
                            <div class="item top m-b20">
                                <div class="flex m-b10">
                                    <div class="label">上级网格:</div>
                                    <div class="value">{{ "南康镇" }}</div>
                                </div>
                                <div class="flex">
                                    <div class="label">下级网格:</div>
                                    <div class="list fx1">
                                        <span
                                            class="list_item"
                                            v-for="(item, index) in 10"
                                            :key="index"
                                            >第{{ index + 1 }}片区</span
                                        >
                                    </div>
                                </div>
                            </div>
                            <div class="item bottom flexcsh fx1">
                                <div class="flexrsc m-b10">
                                    <div class="label">负责人:</div>
                                    <div class="value">{{ "黄大强" }}</div>
                                    <div class="tel">
                                        {{ "18878947894" }}
                                    </div>
                                </div>
                                <div class="flex of-xhya scroll_bar">
                                    <div class="label">网格员:</div>
                                    <div class="">
                                        <div
                                            v-for="(item, index) in epi.data12"
                                            :key="index"
                                        >
                                            <span class="value">{{
                                                item.title
                                            }}</span>
                                            <span class="tel">{{
                                                item.col3
                                            }}</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </template>
                    <!-- 用作假数据暂时的判断 -->
                </div>

                <div
                    v-else-if="epi.cut_content == 2"
                    class="dialog_content2 full-screen flexcb"
                >
                    <div class="flexrbh m-b10">
                        <div class="info_box fx1 flexrcc m-r20">
                            <span class="label">员工人数: </span>
                            <span class="value">{{ 564 }}</span>
                        </div>
                        <div class="search_box s_box fx1">
                            <el-input
                                v-model="epi.queryForm12.gridName"
                                placeholder="请输入内容"
                            ></el-input>
                            <div
                                class="search_btn flexrcc"
                                @click="searchCompany12"
                            >
                                <span class="txt">搜 索</span>
                            </div>
                            <div
                                class="reset_btn flexrcc"
                                @click="searchCompany12(2)"
                            >
                                <span class="txt">重 置</span>
                            </div>
                        </div>
                    </div>

                    <div class="fx1 hidden">
                        <StaticTable
                            :columns="epi.columns12"
                            :data-list="epi.data12"
                            headBg="rgba(22, 159, 196, 0.2)"
                            border_color="rgba(22, 159, 196, 0.25)"
                            headHeight="40"
                        >
                            <template v-slot:col4="{ row }">
                                <div class="census epi_census">
                                    {{ row.col4 }}
                                </div>
                            </template>
                        </StaticTable>
                    </div>
                    <!-- 分页 -->
                    <ProPage
                        :pages="epi.pages12"
                        ref="ref_page12"
                        @on_page="changePage($event, 12)"
                    ></ProPage>
                </div>
                <div
                    v-else-if="epi.cut_content == 3"
                    class="dialog_content3 full-screen flexcb"
                >
                    <div class="select_box flexrsc m-b20">
                        <span class="icon">*</span>
                        <span class="label">检测轮次</span>
                        <div class="select_grade m-r30">
                            <el-select
                                v-model="epi.queryForm12.num"
                                placeholder=""
                            >
                                <el-option
                                    v-for="item in epi.options12"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                >
                                </el-option>
                            </el-select>
                        </div>
                        <div
                            class="search_btn flexrcc m-r20"
                            @click="searchCompany13"
                        >
                            <span class="txt">查 看</span>
                        </div>
                        <div
                            class="reset_btn flexrcc"
                            @click="searchCompany13(2)"
                        >
                            <span class="txt">最近一次</span>
                        </div>
                    </div>
                    <div class="data_box fx1">
                        <div class="box1 flexcbh">
                            <div class="box1_top flexccc m-b20">
                                <div class="">
                                    <span class="num text">1530</span>
                                    <span class="unit text">人</span>
                                </div>
                                <div class="label">员工数量</div>
                            </div>
                            <div class="box1_bottom fx1 flexcbh">
                                <div class="fx1 flexccc">
                                    <div class="flexrbc">
                                        <span class="num text">97.64%</span>
                                        <div class="rise">
                                            <span
                                                class="iconfont icon-shangsheng"
                                            ></span>
                                            <span>-0.52%</span>
                                        </div>
                                    </div>
                                    <div class="label">本轮检测率</div>
                                </div>
                                <div class="fx1 flexccc">
                                    <div class="">
                                        <span class="num text">98.16%</span>
                                    </div>
                                    <div class="label">上轮检测率</div>
                                </div>
                            </div>
                        </div>
                        <div class="box2 flexcbh">
                            <div class="box2_top fx1 m-b20 flexcbh">
                                <div class="chart flexrcc fx1">
                                    <pie-chart
                                        :seriesData="epi.seriesDataPie"
                                        :extraOption="epi.extraOptionPie"
                                    ></pie-chart>
                                </div>
                                <div class="info flexcc">
                                    <div class="item top flexrbc m-b10">
                                        <span
                                            ><span class="icon">▋</span
                                            >本轮已检测</span
                                        >
                                        <span class="num">1494</span>
                                        <span class="num">97.64%</span>
                                    </div>
                                    <div class="item bottom flexrbc">
                                        <span
                                            ><span class="icon">▋</span
                                            >本轮未检测</span
                                        >
                                        <span class="num">36</span>
                                        <span class="num">10%</span>
                                    </div>
                                </div>
                            </div>
                            <div class="box2_bottom flexcc">
                                <span class="label m-b10"
                                    >本轮新增未测 (人)</span
                                >
                                <span class="num">34</span>
                            </div>
                        </div>
                        <div class="box3 flexcbh">
                            <div class="box3_top fx1 m-b20 flexcbh">
                                <div class="chart flexrcc fx1">
                                    <pie-chart
                                        :seriesData="epi.seriesDataPie2"
                                        :extraOption="epi.extraOptionPie2"
                                    ></pie-chart>
                                </div>
                                <div class="info flexcc">
                                    <div class="item top flexrbc m-b10">
                                        <span
                                            ><span class="icon">▋</span
                                            >已核实总数</span
                                        >
                                        <span class="num">36</span>
                                        <span class="num">100%</span>
                                    </div>
                                    <div class="item bottom flexrbc">
                                        <span
                                            ><span class="icon">▋</span
                                            >未核实总数</span
                                        >
                                        <span class="num">0</span>
                                        <span class="num">0%</span>
                                    </div>
                                </div>
                            </div>
                            <div class="box3_bottom flexcc">
                                <span class="label m-b10"
                                    >近两轮均未测 (人)</span
                                >
                                <span class="num">2</span>
                            </div>
                        </div>
                        <div class="box4 flexcbc">
                            <div class="box41">
                                <gauge-chart
                                    :seriesData="epi.seriesDataGauge"
                                    :seriesData2="epi.seriesDataGauge2"
                                    :extraOption="epi.extraOptionsGauge"
                                ></gauge-chart>
                            </div>
                            <div class="box42 m-b10 flexrcc">上轮整改率</div>
                            <div class="box43 m-b10 flexccc">
                                <div class="">
                                    <span class="num text">28</span>
                                    <span class="unit text">人</span>
                                </div>
                                <div class="label">上轮未测</div>
                            </div>
                            <div class="box44 flexccc">
                                <div class="">
                                    <span class="num text">26</span>
                                    <span class="unit text">人</span>
                                </div>
                                <div class="label">其中本轮检测</div>
                            </div>
                        </div>
                    </div>
                </div>
                <div
                    v-else-if="epi.cut_content == 4"
                    class="dialog_content4 full-screen flexcb"
                >
                    <div class="fx1 hidden">
                        <StaticTable
                            :columns="epi.columns14"
                            :data-list="epi.data14"
                            headBg="rgba(22, 159, 196, 0.2)"
                            border_color="rgba(22, 159, 196, 0.25)"
                            headHeight="40"
                        >
                            <template v-slot:col5="{ row }">
                                <div class="epi_census">
                                    {{ row.col5 }}
                                </div>
                            </template>
                        </StaticTable>
                    </div>
                    <!-- 分页 -->
                    <ProPage
                        :pages="epi.pages12"
                        ref="ref_page12"
                        @on_page="changePage($event, 12)"
                    ></ProPage>
                </div>
            </div>
        </ListDetail>
    </div>
</template>

<script>
import ProTitle from "@/components/Pro/ProTitle";
import ProTitle2 from "@/components/Pro/ProTitle2";
import StaticTable from "@/components/Common/StaticTable.vue";
import ProShade from "./ProShade";
import PieChart from "@/components/Chart/PieChart/PieChart.vue";
import LineChart from "@/components/Chart/LineChart/LineChart.vue";
import BarChart from "@/components/Chart/BarChart/BarChart.vue";
import ListDetail from "./ListDetail";
import DynamicTable from "@/components/Common/DynamicTable.vue";
import ProPage from "./ProPage";
import EpiContentNav from "./EpiContentNav";
import ProDialog from "./ProDialog";
import GaugeChart from "@/components/Chart/GaugeChart/GaugeChart.vue";

import { my_option } from "@/utils/mock/proview/grid";

import { listGrid } from "@/api/epiview.js";
import { listBigScreenGridPage, detectRatioRank } from "@/api/grid.js";
import { people } from "@/utils/mock/proview/people";

import {
    getCompany,
    listCompanyWork,
    listWork,
    detailWork,
} from "@/api/proview.js";
import { defaults } from "js-cookie";

export default {
    name: "NavGrid",
    components: {
        ProTitle,
        ProTitle2,
        DynamicTable,
        StaticTable,
        ProShade,
        PieChart,
        LineChart,
        BarChart,
        ListDetail,
        ProPage,
        EpiContentNav,
        ProDialog,
        GaugeChart,
    },
    props: {
        company_type: {
            type: Array,
            default: () => [],
        },
        level: {
            type: Number,
            default: 0,
        },
        temporaryListDetailId: {
            type: Number,
            default: 0,
        },
    },
    data() {
        return {
            map_dialog: false,
            loading: false,
            loading2: false,
            compnyType: false,
            //信息-------------------------------
            epi: {
                table_date: null,
                open_detail: false,
                detail_title: "南康社区",
                pages: 1,

                data: [{ title: 1, col2: "XXXWH网格", col3: 90 }],
                columns1: my_option.columns1,
                cut_companyid: "",
                queryForm: {
                    sort_by: false, // asc (true) 正序  desc(false) 倒序
                    company_name: "",
                    roundId: null,
                    lastTimeFlag: true,
                },

                data2: [
                    // { title: 1, col2: "xxxxgss公司", col3: "xxv镇", col4: 234 },
                ],
                columns2: my_option.columns2,
                queryForm2: {
                    current: 1,
                    gridName: "",
                    level: 2,
                    size: 10,
                    sortList: [
                        {
                            asc: false,
                            column: "",
                        },
                    ],
                },
                total2: 1,
                pages2: 1,

                // 详情-----
                cut_content: 1,
                detail_btn: [
                    { label: "网格信息", id: 1 },
                    { label: "居民信息", id: 2 },
                    { label: "检测信息", id: 3 },
                    { label: "对比名单", id: 4 },
                ],
                queryForm12: {
                    company_id: "",
                    current: 1,
                    size: 13,
                    name: "",
                },
                columns12: my_option.columns12,
                data12: [
                    {
                        title: "韦凤莲",
                        col2: "450525195706128323",
                        col3: "18077968496",
                        col4: "户籍人口",
                    },
                    {
                        title: "张基尧",
                        col2: "452825194302243310",
                        col3: "18777916208",
                        col4: "户籍人口",
                    },
                    {
                        title: "杜积光",
                        col2: "452825194807163324",
                        col3: "18577924182",
                        col4: "户籍人口",
                    },

                    {
                        title: "黄家群",
                        col2: "450525196807163000",
                        col3: "13317691582",
                        col4: "户籍人口",
                    },
                    {
                        title: "林明毅",
                        col2: "450512200006080033",
                        col3: "17774815201",
                        col4: "户籍人口",
                    },
                    {
                        title: "黄顺源",
                        col2: "450525195106153373",
                        col3: "13807890959",
                        col4: "户籍人口",
                    },
                    {
                        title: "欧作婕",
                        col2: "450525195703153347",
                        col3: "13877970322",
                        col4: "户籍人口",
                    },
                ],
                total12: 1,
                pages12: 1,

                seriesDataPie: [
                    {
                        name: "已完成",
                        value: 80,
                    },
                    {
                        name: "未完成",
                        value: 20,
                    },
                ],
                extraOptionPie: my_option.extraOptionPie,
                seriesDataPie2: [
                    {
                        name: "已完成",
                        value: 80,
                    },
                    {
                        name: "未完成",
                        value: 20,
                    },
                ],
                extraOptionPie2: my_option.extraOptionPie2,
                seriesDataGauge: [
                    {
                        value: 92.85,
                        // name: "整改",
                    },
                ],
                seriesDataGauge2: [
                    {
                        value: 92.85,
                        // name: "整改",
                    },
                ],
                extraOptionsGauge: my_option.extraOptionsGauge,

                queryForm14: {
                    company_id: "",
                    current: 1,
                    size: 13,
                    name: "",
                },
                columns14: my_option.columns14,
                data14: [
                    {
                        title: 1,
                        col2: "张xx",
                        col3: "450320199911112121",
                        col4: "18579795555",
                        col5: "户籍人口",
                        col6: "忘记",
                        col7: "是",
                        col8: "铁山港医院",
                    },
                ],
                total14: 1,
                pages14: 1,
            },
            // 地图点的集合
            MarkerData: [],

            // 列表明细弹出层--------------------------
            open_detail: false,
            detail_title: "详情",
            list_columns: my_option.list_columns,
            list_info: [],
            // 作业详情弹出层----------------------------
            open_detail2: false,
            detail2_title: "作业明细",
            detail2_info: {},
        };
    },
    computed: {
        // 0 计算是否 跨列
        getAcrossCol() {
            return (p) => {
                if (p == 3) return "across-col3";
                else if (p == 2) return "across-col2";
                else return "";
            };
        },

        // 行业类型
        getIndustry() {
            return (s) => {
                s = Number(s);
                let temp = null;
                switch (s) {
                    case 1:
                        temp = "农、林、牧、渔业";
                        break;
                    case 2:
                        temp = "采矿业";
                        break;
                    case 3:
                        temp = "制造业";
                        break;
                    case 4:
                        temp = "电力、热力、燃气及生产和供应业";
                        break;
                    case 5:
                        temp = "建筑业";
                        break;
                    case 6:
                        temp = "批发和零售业";
                        break;
                    case 7:
                        temp = "交通运输、仓储和邮政业";
                        break;
                    case 8:
                        temp = "住宿和餐饮业";
                        break;
                    case 9:
                        temp = "信息传输、软件和信息技术服务业";
                        break;
                    case 10:
                        temp = "金融业";
                        break;
                    default:
                        temp = "空";
                }
                return temp;
            };
        },

        // 作业类型
        getType() {
            return (p) => {
                if (p == 1) return "吊装作业";
                else if (p == 2) return "动火作业";
                else if (p == 3) return "动土作业";
                else if (p == 4) return "断路工作";
                else if (p == 5) return "高处作业";
                else if (p == 6) return "设备检维修作业";
                else if (p == 7) return "盲板抽堵作业";
                else if (p == 8) return "受限空间作业";
                else {
                    return "-";
                }
            };
        },
        // 处理结果
        getResult() {
            return (p) => {
                if (p == 1) return "进行中";
                else if (p == 2) return "成功";
                else if (p == 3) return "失败";
                else {
                    return "-";
                }
            };
        },
    },

    watch: {},

    created() {
        // this.getData();
        // this.getData2();
        // this.getData3();
        this.temporaryData();
    },
    mounted() {},
    methods: {
        //临时假数据
        temporaryData() {
            this.epi.data12 = people.list_columns.map((item) => {
                return {
                    title: item.name,
                    col2: item.code,
                    col3: item.phone,
                    col4: item.tag2,
                };
            });
        },
        /** 关闭地图的消息弹窗(给父组件调用) */
        closeMap(id) {
            this.MarkerData.forEach((item) => {
                if (id == this.epi.cut_companyid) {
                    // 点击x号 关闭 当前消息窗口
                    item.level = 28;
                } else {
                    // 点击另外的地图标点, 关闭旧窗口, 打开新窗口时, 保留新窗口的icon高亮
                    if (item.id != this.epi.cut_companyid) {
                        item.level = 28;
                    }
                }
            });
        },
        /** 点击地图弹窗详情(给父组件调用) */
        detailMap(id) {
            this.epi.open_detail = true;
            this.open_detail = false;
            // this.epi.cut_companyid = id;
        },
        /** 点击表格的某行 */
        onRow2(row) {
            this.epi.open_detail = true;
        },

        /** 点击企业列表 的某列 */
        onClick(row, col) {
            // if (col.prop == "title") {
            //     this.epi.open_detail = true;
            //     this.epi.detail_title = row.title;
            //     // this.getCompany(row.id);
            //     this.epi.cut_companyid = row.id;
            //     this.epi.open_detail = true;
            //     this.open_detail = false;
            // } else if (col.prop == "col3") {
            //     this.getIntroduction(row.id, true);
            // } else if (col.prop == "col4") {
            //     this.epi.open_detail = false;
            //     this.open_detail = true;
            //     this.detail_title = row.title;
            //     this.epi.queryForm2.company_id = row.id;
            //     this.epi.queryForm2.current = 1;
            //     if (this.$refs["ref_page2"])
            //         this.$refs["ref_page2"].resetPage();
            //     this.listWork();
            // }
            // this.$emit("onClick", row, col);
        },
        //
        onClickDetail(row, col) {
            this.detail2_title = row.col3;
            if (col.prop == "col7") {
                this.open_detail2 = true;
                this.detailWork(row.id);
            }
        },
        /** 关闭列表明细 */
        onCloseInfo() {
            this.$emit("myclose", false);
        },
        /** 关闭详情 */
        onCloseDetail() {
            this.open_detail2 = false;
        },
        /** 重置弹窗数据 */
        reset() {
            this.epi.open_detail = false;
            this.$refs["ref_detail"].reset();
        },
        /** 分页切换 */
        changePage(num, type) {
            if (type == 28) {
                this.epi.queryForm2.current = num;
                this.getData2();
            }
        },
        hangePage1(num, type) {
            if (type == 28) {
                this.epi.queryForm2.current = num;
                this.getData3();
            }
        },

        /** 搜索 */
        searchCompany(type = 1) {
            this.epi.queryForm2.current = 1;
            if (this.$refs["ref_page2"]) this.$refs["ref_page2"].resetPage();
            if (type == 2) {
                this.epi.queryForm.lastTimeFlag = true;
                this.epi.table_date = null;
            } else if (type == 3) {
                this.epi.queryForm.sort_by = false;
            } else if (type == 4) {
                this.epi.queryForm.sort_by = true;
            }
            this.getData2();
        },
        /** 搜索 */
        searchCompany2(type = 1) {
            this.epi.queryForm2.current = 1;
            if (this.$refs["ref_page2"]) this.$refs["ref_page2"].resetPage();
            if (type == 2) {
                this.epi.queryForm2.date = "";
                this.epi.table_date = null;
            } else if (type == 11) {
                this.epi.queryForm2.level = 1;
            } else if (type == 22) {
                this.epi.queryForm2.level = 2;
            } else if (type == 33) {
                this.epi.queryForm2.level = 3;
            } else if (type == 44) {
                this.epi.queryForm2.level = 4;
            }
            this.getData3();
        },
        /** 搜索 */
        searchCompany12(type = 1) {
            // this.epi.queryForm12.current = 1;
            // if (this.$refs["ref_page12"]) this.$refs["ref_page12"].resetPage();
            // if (type == 2) {
            //     this.epi.queryForm12.name = "";
            // }
            // this.getData12();
        },
        /** 搜索 */
        searchCompany13(type = 1) {
            // this.epi.queryForm12.current = 1;
            // if (this.$refs["ref_page12"]) this.$refs["ref_page12"].resetPage();
            // if (type == 2) {
            //     this.epi.queryForm12.gridName = "";
            // }
            // this.getData12();
        },
        /** 弹窗内容切换 */
        changeContent(id) {
            this.epi.cut_content = id;
        },
        /** 弹窗列表数据 */
        listWork() {
            listWork(this.epi.queryForm2).then((res) => {
                if (res.code == 0) {
                    this.epi.pages = res.data.pages;
                    this.list_info = res.data.data.map((item) => {
                        return {
                            id: item.id,
                            title: item.work_start_time,
                            col2: item.work_end_time,
                            col3: item.work_name,
                            col4: item.type,
                            col5: item.header,
                            col6: item.result,
                            col7: "详情",
                        };
                    });
                }
            });
        },
        /** 弹窗详情数据 */
        detailWork(id) {
            detailWork({ work_id: id }).then((res) => {
                if (res.code == 0) {
                    let data = res.data;
                    let temp = {
                        left: [
                            {
                                label: "特殊作业名称",
                                value: data.work_name,
                            },
                            {
                                label: "类型",
                                value: data.type,
                                is_type: false,
                            },
                            {
                                label: "操作人",
                                value: data.work_user_name,
                                is_list: false,
                            },
                            {
                                label: "操作时间",
                                value: data.work_start_time,
                            },
                            {
                                label: "现场负责人",
                                value: data.header,
                            },
                            {
                                label: "操作方案",
                                value: data.work_norms,
                            },
                            {
                                label: "作业结果",
                                value: data.result,
                                is_result: false,
                            },
                            {
                                label: "操作过程",
                                value: data.process,
                                is_card: true,
                            },
                        ],
                    };
                    this.detail2_info = temp;
                }
            });
        },

        /** 左侧列表数据 */
        getData() {
            if (this.epi.table_date) {
                this.epi.queryForm.date = this.parseTime(
                    this.epi.table_date,
                    "{y}-{m}-{d}"
                );
            } else {
                this.epi.queryForm.date = "";
            }

            this.loading = true;
            let temp = {
                sort_by: this.epi.queryForm.sort_by ? "asc" : "desc",
                company_name: this.epi.queryForm.company_name,
                date: this.epi.queryForm.date,
            };
            listCompanyWork(temp).then((res) => {
                if (res.code == 0) {
                    this.epi.data = res.data.records.map((item, index) => {
                        return {
                            id: item.id,
                            title: index + 1,
                            col2: "xxxxxw网络",
                            col3: 90,
                        };
                    });
                } else {
                    this.epi.data = [];
                }
                this.loading = false;
            });
        },
        /** 右侧列表数据 */
        getData2() {
            this.loading = true;
            let temp = {
                lastTimeFlag: this.epi.queryForm.lastTimeFlag, //查看最近一次
                positiveSequenceFlag: this.epi.queryForm.sort_by, //正序倒序
                roundId: this.epi.queryForm.roundId || 31, //轮次
            };
            detectRatioRank(temp).then((res) => {
                if (res.code == 0) {
                    this.epi.total = res.data.length; // res.data.total;
                    this.epi.data = res.data.map((item, index) => {
                        return {
                            id: item.id,
                            title: index + 1,
                            col2: item.gridName,
                            col3: (parseFloat(item.ratio) * 100).toFixed(2),
                            // col3: item.peopleNumber,
                        };
                    });
                } else {
                    this.epi.data2 = [];
                }
                this.loading = false;
            });
        },
        getData3() {
            console.log("44");
            this.loading2 = true;
            let temp = {
                current: this.epi.queryForm2.current,
                size: this.epi.queryForm2.size,
                level: this.epi.queryForm2.level,
                gridName: this.epi.queryForm2.gridName,
            };
            listBigScreenGridPage(temp).then((res) => {
                if (res.code == 0) {
                    this.epi.total2 = res.data.total;
                    this.epi.pages2 = Math.ceil(
                        parseInt(res.data.total) / parseInt(res.data.size)
                    );
                    this.epi.data2 = res.data.records.map((item, index) => {
                        return {
                            // id: item.id,
                            title: index + 1,
                            col2: item.gridName,
                            col3: item.parentGridName,
                            col4: item.peopleNumber,
                        };
                    });
                    // console.log("33",this.epi.data2)
                } else {
                    this.epi.data2 = [];
                }
                this.loading2 = false;
            });
        },
        /** 点击地图标点emit=false  点击table弹出简介信息时emit=true */
        getIntroduction(id, emit = false) {
            this.epi.cut_companyid = id;
            getCompany(id).then((res) => {
                if (res.code == 0) {
                    let data = res.data;
                    this.epi.detail_title = data.company_name;

                    let temp = [
                        {
                            label: "名称",
                            value: data.company_name,
                        },
                        {
                            label: "行业类型",
                            value: this.getIndustry(data.industry_type),
                            is_industry: true,
                        },
                        {
                            label: "法定代表人",
                            value: data.legal_name,
                        },
                        {
                            label: "法人电话",
                            value: data.legal_phone,
                            is_tel: false,
                        },
                        {
                            label: "查看详情",
                            value: "",
                            is_detail: true,
                            is_video: false,
                        },
                    ];
                }
            });
        },
        /** 点击地图覆盖物emit=false  点击table弹出简介信息时emit=true */
        getIntroduction2(obj, emit = false) {
            console.log(obj);
            this.map_dialog = true;
        },
        onMapClose() {
            this.map_dialog = false;
        },
    },
};
</script>

<style lang="scss">
.el-image-viewer__wrapper {
    top: vh(100);
    bottom: vh(100);
    left: vh(200);
    right: vh(200);
}

.el-loading-spinner .circular .path {
    stroke: #2ef7fc !important;
}

.el-progress__text {
    color: #fff;
}
.el-progress-bar__inner {
    border-radius: vw(1);
    background: linear-gradient(90deg, #0f699c 0%, #49d4ff 100%);
}
</style>

<style lang="scss" scoped>
.container {
    ::v-deep .el-input__inner {
        color: white;
    }
    ::v-deep .el-input--medium .el-input__inner {
        background-color: #002440;
        border: 1px solid #094666;
    }
    .process_line {
        width: vw(200);
        ::v-deep .el-progress-bar__outer {
            border-radius: 0;
            background-color: rgba(255, 255, 255, 0.1);
        }
    }

    .left {
        position: absolute;
        z-index: 12;
        left: vw(30);
        top: vh(88);
        bottom: vh(40);
        width: vw(520);
        .sort_box {
            .sort_btn {
                cursor: pointer;
                padding: 0px 10px;
                height: vh(32);
                background: #002440; // 16171F
                border: 1px solid rgba(22, 159, 196, 0.25);
                .txt {
                    font-size: 14px;
                    color: white;
                }
                &.active {
                    background: rgba(22, 159, 196, 0.2);
                    .txt {
                        color: #61ffff;
                    }
                }
            }
        }
        .title_box {
            padding: 0 vw(10);
            background: rgba(22, 159, 196, 0.2);
            border: 1px solid rgba(45, 205, 255, 0.24);
            border-radius: 2px;
            color: #2dcdff;
        }
    }

    .right {
        position: absolute;
        z-index: 12;
        right: vw(30);
        top: vh(88);
        bottom: vh(40);
        width: vw(520);
        .right-content {
            .grade_box {
                display: grid;
                grid-template-columns: repeat(4, 1fr);
                .sort_btn {
                    cursor: pointer;
                    padding: 0px 10px;
                    height: vh(32);
                    background: #002440; // 16171F
                    border: 1px solid rgba(22, 159, 196, 0.25);
                    .txt {
                        font-size: 14px;
                        color: white;
                    }
                    &.active {
                        background: rgba(22, 159, 196, 0.2);
                        .txt {
                            color: #61ffff;
                        }
                    }
                }
            }
        }
    }

    .iconfont {
        margin-right: vw(5);
    }

    // 弹出层
    .dialog_box {
        position: absolute;
        z-index: 15;
        left: 0;
        top: vh(56);
        height: calc(100% - vh(56));
        width: 100%;
        background: rgba(0, 6, 17, 0.5);
        backdrop-filter: blur(20px);

        .dialog_content1 {
            .content_left {
                .item {
                    width: vw(400);
                    height: vh(220);
                    .icon {
                        width: vw(120);
                        height: vw(120);
                        margin-right: vw(30);
                    }
                    .icon1 {
                        background: url("~@/assets/images/proview/grid1.png")
                            no-repeat;
                        background-size: 100% 100%;
                    }
                    .icon2 {
                        background: url("~@/assets/images/proview/grid2.png")
                            no-repeat;
                        background-size: 100% 100%;
                    }
                    .info {
                        .num1,
                        .unit1 {
                            font-family: "D-DIN";
                            font-style: normal;
                            font-weight: 700;
                            background: linear-gradient(
                                180deg,
                                #61ffff 0%,
                                #2dcdff 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                        .num2,
                        .unit2 {
                            font-family: "D-DIN";
                            font-style: normal;
                            font-weight: 700;
                            background: linear-gradient(
                                180deg,
                                #f5d665 0%,
                                #e39c49 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                        .num1,
                        .num2 {
                            font-size: vw(40);
                        }
                        .unit1,
                        .unit2 {
                            font-size: vw(14);
                        }
                        .label {
                            background: rgba(22, 159, 196, 0.2);
                            border-radius: 2px;
                            text-align: center;
                            color: #fff;
                            padding: vh(3) 0;
                            width: 100%;
                        }
                        .label1 {
                            background: rgba(22, 159, 196, 0.2);
                        }
                        .label2 {
                            background: rgba(227, 156, 73, 0.2);
                        }
                    }
                }
                .item_grid1 {
                    border: 1px solid rgba(22, 159, 196, 0.3);
                    background: url("~@/assets/images/proview/grid_bg1.png")
                        no-repeat;
                    background-size: 100% 100%;
                }
                .item_grid2 {
                    border: 1px solid rgba(227, 156, 73, 0.3);
                    background: url("~@/assets/images/proview/grid_bg2.png")
                        no-repeat;
                    background-size: 100% 100%;
                }
            }
            .content_right {
                .item {
                    border: 1px solid rgba(22, 159, 196, 0.25);
                    padding: vh(24) vw(20);

                    .label {
                        color: #fff;
                        margin-right: vw(20);
                    }
                    .value {
                        color: #2ef7fc;
                    }
                    .tel {
                        margin-left: vw(20);
                        color: #fff;
                    }
                    .list {
                        display: grid;
                        grid-template-columns: repeat(5, 1fr);
                        grid-template-rows: auto;
                        gap: vh(10) vw(10);
                        color: #2ef7fc;
                        .list_item {
                        }
                    }
                }
                .top {
                    background: rgba(22, 159, 196, 0.2);
                }
                .bottom {
                    // background: rgba(22, 159, 196, 0.2);
                }
            }
        }
        .dialog_content2 {
            .info_box {
                background: rgba(22, 159, 196, 0.2);
                border: 1px solid rgba(22, 159, 196, 0.25);
                .label {
                    color: #fff;
                    margin-right: vw(10);
                }
                .value {
                    font-family: "D-DIN";
                    font-weight: 700;
                    font-size: vw(24);
                    background: linear-gradient(
                        180deg,
                        #61ffff 0%,
                        #2dcdff 100%
                    );
                    -webkit-background-clip: text;
                    -webkit-text-fill-color: transparent;
                    background-clip: text;
                    text-fill-color: transparent;
                }
            }
        }
        .dialog_content3 {
            .select_box {
                .icon {
                    color: #2ef7fc;
                }
                .label {
                    color: #fff;
                    margin-left: vw(5);
                }
                .select_grade {
                    margin-left: vw(20);
                }
                .search_btn {
                    width: vw(100);
                    cursor: pointer;
                    height: vh(36);
                    background: linear-gradient(
                        180deg,
                        #033748 0%,
                        #169fc4 100%
                    );
                    border: 1px solid rgba(41, 173, 249, 0.4);
                    .txt {
                        font-size: 14px;
                        color: white;
                    }
                }
                .reset_btn {
                    width: vw(100);
                    cursor: pointer;
                    height: vh(36);
                    background: #002440; // 16171F
                    border: 1px solid rgba(41, 173, 249, 0.4);
                    .txt {
                        font-size: 14px;
                        color: white;
                    }
                }
            }
            .data_box {
                display: grid;
                grid-template-columns: repeat(4, 1fr);
                grid-template-rows: 1fr;
                gap: 0 vh(20);
                .box1 {
                    border: 1px solid rgba(22, 159, 196, 0.3);
                    padding: vw(20);
                    .box1_top {
                        height: vh(127);
                        background: url("~@/assets/images/proview/box1_top.png")
                            no-repeat;
                        background-size: 100% 100%;
                        .text {
                            font-family: "D-DIN";
                            font-style: normal;
                            font-weight: 700;
                            background: linear-gradient(
                                180deg,
                                #61ffff 0%,
                                #2dcdff 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                        .num {
                            font-size: vw(40);
                        }
                        .unit {
                            font-size: vw(14);
                        }
                        .label {
                            color: #ffffff;
                        }
                    }
                    .box1_bottom {
                        border: 1px solid rgba(22, 159, 196, 0.3);
                        background: linear-gradient(
                            180deg,
                            rgba(22, 159, 196, 0.12) 0%,
                            rgba(22, 159, 196, 0) 100%
                        );
                        padding: vw(10);
                        .text {
                            font-family: "D-DIN";
                            font-style: normal;
                            font-weight: 700;
                            background: linear-gradient(
                                180deg,
                                #61ffff 0%,
                                #2dcdff 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                        .num {
                            font-size: vw(40);
                        }
                        .rise {
                            background: rgba(22, 159, 196, 0.2);
                            border: 1px solid rgba(22, 159, 196, 0.25);
                            border-radius: 2px;
                            color: #ff3a3a;
                            margin-left: vw(10);
                            padding: vh(5) vw(8);
                            font-weight: 600;
                            font-size: vw(16);
                            border-radius: vw(3);
                        }
                        .label {
                            color: #ffffff;
                        }
                    }
                }
                .box2 {
                    .box2_top {
                        border: 1px solid rgba(22, 159, 196, 0.3);
                        padding: vw(20);
                        .chart {
                            height: vw(196);
                            .cc {
                                width: vw(120);
                                height: vw(120);
                                background-color: #2dcdff;
                                border-radius: 50%;
                            }
                        }
                        .info {
                            .item {
                                // padding: vh(10) vw(12);
                                color: #fff;
                                .num {
                                    font-family: "D-DIN";
                                    font-style: normal;
                                    font-weight: 700;
                                    font-size: vw(20);
                                }
                            }
                            .top {
                                // background: rgba(22, 159, 196, 0.2);
                                // border: 1px solid rgba(22, 159, 196, 0.25);
                                .icon {
                                    color: #2dcdff;
                                }
                            }
                            .bottom {
                                // background: rgba(238, 144, 104, 0.2);
                                // border: 1px solid rgba(238, 144, 104, 0.25);
                                .icon {
                                    color: #ee9068;
                                }
                            }
                        }
                    }

                    .box2_bottom {
                        padding: vw(20);
                        height: vh(84);
                        background: rgba(22, 159, 196, 0.2);
                        border: 1px solid rgba(22, 159, 196, 0.25);
                        .label {
                            color: #ffffff;
                        }
                        .num {
                            font-family: "D-DIN";
                            font-weight: 700;
                            font-size: vw(24);
                            background: linear-gradient(
                                180deg,
                                #ffc27a 0%,
                                #ff9a3d 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                    }
                }
                .box3 {
                    .box3_top {
                        border: 1px solid rgba(22, 159, 196, 0.3);
                        padding: vw(20);
                        .chart {
                            height: vw(196);
                            .cc {
                                width: vw(120);
                                height: vw(120);
                                background-color: #2dcdff;
                                border-radius: 50%;
                            }
                        }
                        .info {
                            .item {
                                // padding: vh(10) vw(12);
                                color: #fff;
                                .num {
                                    font-family: "D-DIN";
                                    font-style: normal;
                                    font-weight: 700;
                                    font-size: vw(20);
                                }
                            }
                            .top {
                                // background: rgba(22, 159, 196, 0.2);
                                // border: 1px solid rgba(22, 159, 196, 0.25);
                                .icon {
                                    color: #2dcdff;
                                }
                            }
                            .bottom {
                                // background: rgba(238, 144, 104, 0.2);
                                // border: 1px solid rgba(238, 144, 104, 0.25);
                                .icon {
                                    color: #ee9068;
                                }
                            }
                        }
                    }

                    .box3_bottom {
                        padding: vw(20);
                        height: vh(84);
                        background: rgba(22, 159, 196, 0.2);
                        border: 1px solid rgba(22, 159, 196, 0.25);
                        .label {
                            color: #ffffff;
                        }
                        .num {
                            font-family: "D-DIN";
                            font-weight: 700;
                            font-size: vw(24);
                            background: linear-gradient(
                                180deg,
                                #ff7a7a 0%,
                                #ff3d3d 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                    }
                }
                .box4 {
                    border: 1px solid rgba(22, 159, 196, 0.3);
                    padding: vw(20);
                    .box41 {
                        height: vh(130);
                        width: 100%;
                    }
                    .box42 {
                        background: rgba(45, 164, 255, 0.1);
                        border: 0.675px solid rgba(45, 204, 255, 0.2);
                        color: #ffffff;
                        height: vw(35);
                        width: vw(180);
                        font-size: vw(13);
                    }
                    .box43,
                    .box44 {
                        height: vh(80);
                        width: vw(180);
                        background: url("~@/assets/images/proview/num_box.png")
                            no-repeat;
                        background-size: 100% 100%;
                        .text {
                            font-family: "D-DIN";
                            font-style: normal;
                            font-weight: 700;
                            background: linear-gradient(
                                180deg,
                                #61ffff 0%,
                                #2dcdff 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                        .num {
                            font-size: vw(40);
                        }
                        .unit {
                            font-size: vw(14);
                        }
                        .label {
                            color: #ffffff;
                        }
                    }
                }
            }
        }
    }
}
</style>
